/**
 * 
 */
package com.gmail.avereshchaga.web.validate;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * @author <a href="mailto:avereshchaga@gmail.com">Vereshchaga Alexey</a>
 *
 */


@Target({ FIELD })
@Retention(RUNTIME)
@Constraint(validatedBy = ExisitingDivisionValidator.class)
@Documented
public @interface ExisitingDivision {
    
    public static final String MESSAGE = "Division already exist";

    public abstract String message() default MESSAGE;

    public abstract Class<?>[] groups() default {};

    public abstract Class<? extends Payload>[] payload() default {};
    
    
    @Target({ FIELD })
    @Retention(RUNTIME)
    @Documented
    public @interface List {
        ExisitingDivision[] value();
    }

}
